/**
 * <p>Title: ResponseUtils.java</p>
 * <p>Description: </p> 
 * @author xuchang 
 * @date 2018年8月7日
 */
package com.bclz.common.response;

import com.bclz.common.constant.WebConstants;

/**  
* Title: ResponseUtils  
* Description:   
* @author xuchang  
* @date 2018年8月7日  
*/
public class ResponseUtils {
		
	
	public static ResponseData success(String msg,Object data) {
		ResponseData r=new ResponseData();
		r.setCode(WebConstants.SUCCEED_CODE);
		r.setMsg(msg);
		if(data!=null) {
			r.setData(data);
		}
		return r;
	}
	
	public static ResponseData fail(String msg,Object data) {
		ResponseData r=new ResponseData();
		r.setCode(WebConstants.FAIL_CODE);
		r.setMsg(msg);
		if(data!=null) {
			r.setData(data);
		}
		return r;
	}
	
}
